package com.bianguo.android.apushdemo.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

import com.bianguo.android.apushdemo.view.activity.MainActivity;
import com.bianguo.android.apushdemo.utils.MyLog;

/**
 * Created by Administrator on 2017/7/21.
 */

public class MyReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        MyLog.mLog("action = " + action);
        Toast.makeText(context, "action = " + action, Toast.LENGTH_SHORT).show();
        Intent mIntent = new Intent(context, MainActivity.class);
        mIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(mIntent);
    }
}
